Bluetooth Counter
NirZaidmanandMichaelTahar
Theproject
Howcanitbeused
Howdoesitwork
Launchpad
Features
Maindifficulties
Scan
Examples
Courseoriented
Server
assumptions
TheFlow
The Project
OurprojectusetheTI-CC2650Launchpadinorderto
monitorBluetoothdevicesnearby.
WeusedtheLaunchpadinordertoscanandcount
Bluetoothdevicesintheneararea,atgiventime.
Thisinformationissenttooursever(bydesignated
appinadmin’sphone),andshowninformofagraph.
The Flow
TheLaunchpadscans
fornearbydevices
Theapppullsthedata
fromtheLaunchpad
Theappsendsthe
datatotheserver
How can it be used
Wethinkthisprojectcanhavemanyreal-lifeuses:
-Lecturerthatwantstoknowhowmanystudents
attendedhisclass.
-Storeownerthatwantstoknowwhatisthepeak
hourintheday,andwhatthedistributionofpeople
enteredthestoreduringtheday.
-Culturalinstitutions(i.e.museum)thatwantsto
monitorthepopularityofexhibitsbymeasuringthe
numberofpeoplearoundit.
How can it be used
-Publictransportation–monitoringdistributionof
passengersinstations/busesinordertoplanadjusted
transportation.
-Lines–followlinesbehaviorduringgiventime.
locationis-Peoplecanuseittocheckifspecific
crowded.
report.-CC2650Launchpadaccuracy
How does it work
TheLaunchpadcanscanfornearbyBluetoothdevicesby
usingitsBLEtechnology.WemadetheLaunchpadscan
forallexistingdevicesandtocountthem.
TheLaunchpadsavestheresultsandsendsthemtothe
smartphoneviadesignatedappwewrote(forandroid),
thatpullstheresultsandsendsittotheserver.
Theserveranalyzethedataandpresentitinformofa
graph.
How does it work - Launchpad
TheLaunchpadscanforallthenearbydevices.Inordertoget
moreaccurateresult,wescanseveraltime(canbe
configured)andcalculatetheaverageresult.
TheLaunchpadalsohaveaclockfunctionthatscansevery
specificamountoftime(canbechanged).
Thescanningstartsbyclickingtheleftbutton.Thisclick
activatesthescanfunction.
How does it work - scan
TheLaunchpadsendsdiscoveryrequest(bycreatingdiscovery
message).Thismessageisundirected(senttoeveryone).
Than,theLaunchpadmonitorsallscanresponsesthatarrives
andcountthem.Everyresponsehaveaddressanddata.
Whenthemessagearrivesfromnewaddressandthedatais
responsedata,weaddthisdevicestothecount.
How does it work -server
TheserverhaveoneservicethathandlesincomingHTTPGET,the
serviceholdsalistsampleseachsamplerepresentonehourona
singledateanditholdsallthesamplesthatwerecollectedforthis
hour.
:therearetwotypesofrequests
sample-requestfromtheappwithnewinformationfrom1.new
).Thethesensor,theserviceaddsthesampletothedatabase(File
servicewilladdthenewdatatothecorrectsampleinthelist
accordingtothedateandhour.
JQUERY..presentation-createsanHTMLpageusingCSSand2
serverwaswrittenusingJAVAandJSP.The
It’s not bug it’s a feature
Inordertogetthebestresults,weaddedthefollowing:
-Applynumberofscansinarow,andthantaketheaverage.Thiswill
decreasethestatisticerror.
-Calculatesthevarianceofthesamplesinordertoevaluatethequalityof
thesamples
-Givetheuseroptiontoconfigurethenumberofsampleshewantsto
make.
-Theservercandisplaydatafromvariousdays.
Main difficulties
-Themaindifficultywastolearnhowthescanworks.Wehadtouse
projectzeroandTIforums(wealsopostedsomequestionthere)to
understandthesyntaxandwhataretherelevantfunctionweneedto
use.
-Anothermaindifficultywastodeveloptheandroidappandtheserver
thatconnectswiththeappanddisplaystheresult.
-Wenoticedthatinfollowingscanswegotdifferentvalues(usually
owedecidedtodecreasethiserrorbymakingseriessdifferenceof1),
ofexamplesandtakeitsaverage.Thiswaywegetmoreaccurateresults.
Inordertogivetheuserthewholedata,wealsocalculatedthevariance
ofthesamplessotheusercouldknowthequalityofthedata.
Examples - configuration
Herewecanreadthesamples
Herewecanconfiguretheamountof
sampleswewanttodoeveryscan
Examples – scan messages
Examples - results
Thisisthe
variance
Examples - results
Theserverkeepstheresultandwe
canchoosethewanteddate
Examples - results
hour
#samples
date
Assumptions/limitations
-Thenumberofmeasuresineveryscanwillbelowerthan240.
-Themaximumnumberofdevicescanbeupto254(255meansendof
results).
-TheprojectdealswithBluetoothdevices–weassumethatallthe
devicesthatheedstobemonitoredhaveBluetoothon.
-Thedefaultscanningintervalis10minutes.
Course oriented
class(cc2650LaunchpadbyTI).weusedinthatthehardware-Weused
-TheprojectusetheBLEoptionoftheLaunchpadthatwelearned
about.Weusedthesimple-linkacademyexamples(andprojectzero)to
understandtheadvertisingandscanningmessagesthattheLaunchpad
sends.
-Weusedtheappinordertoconfigurethescanningarguments.
nd
-Weimplementedclockandbuttonhandleraswedidinthe2
exercise.